<?php
	
 include_once("../interface/globals.php");
 include_once("$srcdir/patient.inc");
 include_once("$srcdir/forms.inc");
 
$values = $_REQUEST;
if($values['check_muni']==1){
	$retuurn = '';
	$dep_id = $values['id'];
	$query = "SELECT * FROM municipios WHERE id like '$dep_id%'";
	$res = sqlStatement($query);
        $retuurn .= "<option value=''>N/A</option>";
	while($row = sqlFetchArray($res)){
		$new_val = $row['id'];
		$new_tit = $row['nombre'];
		$retuurn .= "<option value='$new_val'>$new_tit</option>";
	}
	echo $retuurn;
}

if($values['check_centro']==1){
	$retuurn = '';
	$muni_id = $values['id'];
	$query = "SELECT * FROM centro_poblado WHERE id like '$muni_id%'";
	$res = sqlStatement($query);
        $retuurn .= "<option value=''>N/A</option>";
	while($row = sqlFetchArray($res)){
		$new_val = $row['id'];
		$new_tit = $row['nombre'];
		$retuurn .= "<option value='$new_val'>$new_tit</option>";
	}
	echo $retuurn;
}

?>